Fix hypercall migration. schedule_tail() is not required
authorkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 20 Jul 2007 08:38:27 +0000 (09:38 +0100)
committerkfraser@localhost.localdomain <kfraser@localhost.localdomain>
Fri, 20 Jul 2007 08:38:27 +0000 (09:38 +0100)
after set affinity, or else continue stub runs on current
cpu immediately before migrating is checked when switching
out.

Signed-off-by Kevin Tian <kevin.tian@intel.com>
Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/domain.c

index f3241ff160c2501604ac12d72e8a34cef01c3458..4f56b65f0a5abbc9d3e65e92c2a11d453392b0b7 100644 (file)
@@ -1394,6 +1394,9 @@ int continue_hypercall_on_cpu(int cpu, long (*func)(void *data), void *data)
     struct migrate_info *info;
     cpumask_t mask = cpumask_of_cpu(cpu);
 
+    if ( cpu == smp_processor_id() )
+        return func(data);
+
     info = xmalloc(struct migrate_info);
     if ( info == NULL )
         return -ENOMEM;
@@ -1407,8 +1410,9 @@ int continue_hypercall_on_cpu(int cpu, long (*func)(void *data), void *data)
     v->arch.continue_info = info;
 
     vcpu_set_affinity(v, &mask);
-    schedule_tail(v);
 
+    /* Dummy return value will be overwritten by new schedule_tail. */
+    BUG_ON(!test_bit(SCHEDULE_SOFTIRQ, &softirq_pending(smp_processor_id())));
     return 0;
 }